#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <iostream>
using namespace std;
using namespace cv;

int main()
{
    const char* filename = "lena.jpg";
    Mat src, dst1;
    //    src = imread( filename, IMREAD_GRAYSCALE);
    src = imread( filename, IMREAD_COLOR);
    if (src.empty())
    {
        cerr << "Can't open image ["  << filename << "]" << endl;
        return -1;
    }
    namedWindow("Input", WINDOW_AUTOSIZE);
    namedWindow("Output", WINDOW_AUTOSIZE);
    imshow( "Input", src );
    Mat kernel = (Mat_<char>(3,3) <<  0, -1,  0,
                  -1,  5, -1,
                  0, -1,  0);
    filter2D( src, dst1, src.depth(), kernel );
    imshow( "Output", dst1 );
    waitKey();
    return 0;
}
